package com.xs.designpattern;

import lombok.extern.slf4j.Slf4j;

/**
 * 士兵访客
 *
 * @author xs
 */
@Slf4j
public class SoldierVisitor implements UnitVisitor {
    /**
     * 士兵访客方法
     *
     * @param soldier 被拜访的士兵
     */
    @Override
    public void visit(Soldier soldier) {
        log.info("问候 {}", soldier);
    }

    @Override
    public void visit(Sergeant sergeant) {
        // Do nothing
    }

    @Override
    public void visit(Commander commander) {
        // Do nothing
    }
}
